<template>
  <div class="mapMutations">
      mapMutations
      <button @click="addOne">+1</button>
      <button @click="incrOne">-1</button>
      <button @click="add(1)">+1</button>
      <button @click="decrement(1)">-1</button>
      <button @click="addTen({n: 20})">+n</button>
      <button @click="add1(1)">+1</button>
      <button @click="incre1(1)">-1</button>
      <button @click="addTen1({n: 30})">+30</button>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
import { Increment } from '../store/mutation.type'
export default {
  methods: {
    addOne () {
      this.$store.commit('add', 1)
    },
    incrOne () {
      this.$store.commit('decrement', 1)
    },
    ...mapMutations(['add', 'decrement', Increment]),
    ...mapMutations({
      add1: 'add',
      incre1: 'decrement',
      addTen1: Increment
    })
  }
}
</script>

<style scoped>

</style>
